var url="http://localhost:3006/zh"
// // 综合新闻

function addItem(value){
    var templi=document.createElement("li");
    var tempa=document.createElement("a");
    tempa.textContent=value.title;
    tempa.href="#";
    tempa.className=value.time;
    templi.appendChild(tempa);
    return templi;
}

function appendValue(value){
    var idName="sz";
    var divContent=document.getElementById(idName);
    for(var i=0;i<value.length;i++){
        divContent.appendChild(addItem(value[i]));
    }
}

var requestsContent=new XMLHttpRequest();
requestsContent.open("GET",url,true);
requestsContent.onreadystatechange=function(){
    if (requestsContent.readyState === 4 && requestsContent.status === 200){
        appendValue(JSON.parse(requestsContent.responseText));
    }
}
requestsContent.send();